package com.buddy.design.pattern._02singleton;

//注册式单例
//从JDK层面就为枚举不被序列化和反射破坏保驾护航
public enum EnumSingleton {
    INSTANCE;

    private Object data;

    public static EnumSingleton getInstance() {
        return INSTANCE;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
